<ion-view class="ProductStream-view" view-title="单品流水">
    <ion-header-bar class="bar-subheader">
        <im-pull-right>
            <im-search class="demo-search-item" placeholder="请输入单品编号" on-search="search(queryStr)"></im-search>
        </im-pull-right>
    </ion-header-bar>
    <div class="left-hide-navbar">
        <div class="">
            <div class="left-hide-div left-navbar list-icon-hide list-icon-fix_0">
                <span class="nav-title">基本信息</span>
                <span class="left-hide-icon list-icon_0" ng-click="unfold(0)"></span>
            </div>
        </div>
        <div class="">
            <div class="left-hide-div left-navbar list-icon-hide list-icon-fix_1">
                <span class="nav-title">产品参数</span>
                <span class="left-hide-icon list-icon_1" ng-click="unfold(1)"></span>
            </div>
        </div>
        <div class="query-stream" ng-repeat="catalog in data.bizCatalog">
            <div class="left-hide-div left-navbar list-icon-hide list-icon-fix_{{$index+2}}">
                <span class="nav-title">{{catalog.Name}}</span>
                <span class="left-hide-icon list-icon_{{$index+2}}" ng-click="unfold($index+2)"></span>
            </div>
        </div>
    </div>
    <ion-content class="query-context" on-scroll="isScrolling()">
        <div class="exp-content-list">
            <div class="row query-list list-exp_0">
                <div class="col left-navbar">
                    <span class="nav-title exp_0">基本信息</span>
                    <span class="list-icon exp_0" style="visibility: visible;"></span>
                </div>
                <div class="col exp-right-list">
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>芯片ID</span>
                            <span>{{data.Barcode}}</span>
                        </div>
                        <div class="col content-detail content-detail-mid">
                            <span>当前工序</span>
                            <span>{{data.basicInfo.OperationName}}</span>
                        </div>
                        <div class="col content-detail content-detail-right" ng-switch="data.basicInfo.QCStatus">
                            <span>质检状态</span>
                            <span ng-switch-when="0">合格</span>
                            <span ng-switch-when="1" style="color: red">不合格</span>
                            <span ng-switch-when="2">让步接收</span>
                            <span ng-switch-when="3">品质判定</span>
                            <span ng-switch-when="4">返工</span>
                            <span ng-switch-when="5">报废</span>
                        </div>
                    </div>
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>名称</span>
                            <span>{{data.basicInfo.ItemMasterName}}</span>
                        </div>
                        <div class="col content-detail content-detail-mid">
                            <span>规格</span>
                            <span>{{data.basicInfo.Specification}}</span>
                        </div>
                        <div class="col content-detail content-detail-right">
                            <span>分类</span>
                            <span>{{data.basicInfo.ItemCategory}}</span>
                        </div>
                    </div>
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>工单</span>
                            <span>{{data.basicInfo.MOCode}}</span>
                        </div>
                        <div class="col content-detail content-detail-mid">
                            <span>生产批号</span>
                            <span>{{data.basicInfo.MOLotNumber}}</span>
                        </div>
                        <div class="col content-detail content-detail-right">
                            <span>出货批号</span>
                            <span>{{data.basicInfo.ShipLotNumber}}</span>
                        </div>
                    </div>
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>客户</span>
                            <span>{{data.basicInfo.Customer}}</span>
                        </div>
                        <div class="col content-detail content-detail-mid">
                            <span>计划开工</span>
                            <span>{{data.basicInfo.StartDateTime}}</span>
                        </div>
                        <div class="col content-detail content-detail-right">
                            <span>实际开工</span>
                            <span>{{data.basicInfo.RealStartDateTime}}</span>
                        </div>
                    </div>
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>计划完工</span>
                            <span>{{data.basicInfo.EndDateTime}}</span>
                        </div>
                        <div class="col content-detail content-detail-mid">
                            <span>实际完工</span>
                            <span>{{data.basicInfo.RealEndDateTime}}</span>
                        </div>
                        <div class="col content-detail content-detail-right">
                            <span></span>
                            <span></span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row query-list list-exp_1">
                <div class="col left-navbar">
                    <span class="nav-title exp_1">产品参数</span>
                    <span class="list-icon exp_1" style="visibility: visible;"></span>
                </div>
                <div class="col exp-right-list">
                    <div class="row exp-detail">
                        <div class="col content-detail content-detail-left">
                            <span>手柄尺寸</span>
                            <span>{{data.productParam.GripSize}}</span>
                        </div>
                        <div class="col content-detail content-detail-left">
                            <span>外观</span>
                            <span>{{data.productParam.GripSkin}}</span>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row query-list list-exp_{{$index+2}}" ng-repeat="catalog in data.bizCatalog">
                <div class="col left-navbar">
                    <span class="nav-title  exp_{{$index+2}}">{{catalog.Name}}</span>
                    <span class="list-icon  exp_{{$index+2}}" style="visibility: visible;"></span>
                </div>
                <div class="col exp-right-list">
                    <div class="row exp-detail-diy" ng-repeat="rec in catalog.record">
                        <div class="col exp-detail-nav">
                            <span class="right-col list-icon"></span>
                        </div>
                        <span class="icon ion-chevron-down detail-down" aria-hidden="true">
                        </span>
                        <div class="col exp-detail-right" ng-class="{unQc: rec.QCStatus===1}">
                            <div class="row">
                                <div class="col exp-detail-right-date">{{rec.CollectDateTime}}</div>
                                <div class="col exp-detail-right-work">{{rec.WorkName}}</div>
                                <div class="col exp-detail-right-Terminal">{{rec.WorkLocationName}}</div>
                                <div class="col exp-detail-right-user" ng-if="rec.Users.length!==0">
                                    <div ng-repeat="user in rec.Users">{{user.Name}}</div>
                                </div>
                                <div class="col exp-detail-right-user" ng-if="rec.Users.length===0">
                                    <div>未知</div>
                                </div>
                                <div class="col exp-detail-right-qc" ng-show="rec.QCFlag">
                                    <div ng-switch="rec.QCStatus">
                                        <div ng-switch-when="0">
                                            合格
                                        </div>
                                        <div ng-switch-when="1" style="color: red">
                                            不合格
                                        </div>
                                        <div ng-switch-when="2">
                                            让步接收
                                        </div>
                                        <div ng-switch-when="3">
                                            品质判定
                                        </div>
                                        <div ng-switch-when="4">
                                            返工
                                        </div>
                                        <div ng-switch-when="5">
                                            报废
                                        </div>
                                    </div>
                                </div>
                                <div class="col exp-detail-right-qc" ng-show="!rec.QCFlag">{{rec.WorkTime}}</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </ion-content>
</ion-view>
